// 全局移除所有输入框边框，但不影响背景色
.ant-input,
.ant-input-password,
.ant-select-selector,
.ant-input-affix-wrapper,
.ant-input-password-large,
.ant-input-large {
  border: none !important;
  
  input {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
  }
  
  &:focus,
  &.ant-input-focused,
  &:focus-within {
    border: none !important;
    outline: none !important;
    
    input {
      border: none !important;
      outline: none !important;
      box-shadow: none !important;
    }
  }
}

// 直接的input元素 - 强制覆盖所有可能的背景色
input,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="date"] {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  
  // 移除浏览器自动填充的背景色
  &:-webkit-autofill,
  &:-webkit-autofill:hover,
  &:-webkit-autofill:focus,
  &:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    -webkit-text-fill-color: inherit !important;
    background-color: transparent !important;
    background: transparent !important;
  }
}

// 登录页面专用样式
.auth-container {
  // 登录卡片3D效果
  .login-card {
    position: relative;
    transform: perspective(1200px) rotateX(5deg) rotateY(-2deg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    &::before {
      content: '';
      position: absolute;
      top: -2px;
      left: -2px;
      right: -2px;
      bottom: -2px;
      background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
      border-radius: 26px;
      z-index: -1;
    }
    
    &::after {
      content: '';
      position: absolute;
      top: 4px;
      left: 4px;
      right: 4px;
      bottom: 4px;
      background: rgba(0, 0, 0, 0.05);
      border-radius: 20px;
      z-index: -2;
      filter: blur(8px);
    }
    
    &:hover {
      transform: perspective(1200px) rotateX(2deg) rotateY(-1deg) translateY(-4px);
      box-shadow: 
        0 35px 70px rgba(0, 0, 0, 0.25),
        0 15px 30px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.8),
        inset 0 2px 0 rgba(255, 255, 255, 0.9),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1) !important;
    }
    
    .ant-card-body {
      position: relative;
      z-index: 2;
      padding: 32px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 22px;
      backdrop-filter: blur(25px);
    }
  }

  .ant-btn-default {
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 
      0 4px 12px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.6),
      inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    
    &:hover {
      border-color: var(--color-primary-400);
      color: var(--color-primary-500);
      background: rgba(255, 255, 255, 0.5);
      transform: translateY(-1px);
      box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    }
    
    &:active {
      transform: translateY(0);
      box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    }
  }
  
  .ant-btn-link {
    color: var(--color-primary-500);
    
    &:hover {
      color: var(--color-primary-600);
    }
  }
  
  .ant-form-item-label > label {
    font-weight: 500;
    color: var(--color-text-primary);
  }
  
  // 只对登录卡片内的输入框应用3D效果
  .login-card {
    .ant-input,
    .ant-input-password,
    .ant-select-selector {
      border-radius: 12px !important;
      border: none !important;
      background: rgba(255, 255, 255, 0.4) !important;
      backdrop-filter: blur(10px) !important;
      transition: all 0.3s ease;
      box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05) !important;
      
      // 内部input元素完全透明
      input {
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        
        // 移除浏览器自动填充的背景色
        &:-webkit-autofill,
        &:-webkit-autofill:hover,
        &:-webkit-autofill:focus,
        &:-webkit-autofill:active {
          -webkit-box-shadow: 0 0 0 30px transparent inset !important;
          -webkit-text-fill-color: inherit !important;
          background-color: transparent !important;
          background: transparent !important;
        }
      }
      
      &:hover {
        background: rgba(255, 255, 255, 0.5) !important;
        box-shadow: 
          0 4px 12px rgba(0, 0, 0, 0.1),
          inset 0 1px 0 rgba(255, 255, 255, 0.9),
          inset 0 -1px 0 rgba(0, 0, 0, 0.05) !important;
          
        input {
          background: transparent !important;
          background-color: transparent !important;
          
          &:-webkit-autofill,
          &:-webkit-autofill:hover,
          &:-webkit-autofill:focus,
          &:-webkit-autofill:active {
            -webkit-box-shadow: 0 0 0 30px transparent inset !important;
            background-color: transparent !important;
          }
        }
      }
      
      &:focus,
      &.ant-input-focused,
      &:focus-within {
        background: rgba(255, 255, 255, 0.6) !important;
        box-shadow: 
          0 0 0 3px rgba(var(--color-primary-500-rgb), 0.2),
          0 4px 12px rgba(0, 0, 0, 0.1),
          inset 0 1px 0 rgba(255, 255, 255, 0.9),
          inset 0 -1px 0 rgba(0, 0, 0, 0.05) !important;
          
        input {
          background: transparent !important;
          background-color: transparent !important;
          border: none !important;
          outline: none !important;
          box-shadow: none !important;
          
          &:-webkit-autofill,
          &:-webkit-autofill:hover,
          &:-webkit-autofill:focus,
          &:-webkit-autofill:active {
            -webkit-box-shadow: 0 0 0 30px transparent inset !important;
            background-color: transparent !important;
          }
        }
      }
    }
  }
  
  .ant-btn-primary {
    border-radius: 12px;
    height: 44px;
    font-weight: 500;
    font-size: 16px;
    background: var(--color-primary-500);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(var(--color-primary-500-rgb), 0.3);
    transition: all 0.3s ease;
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 16px rgba(var(--color-primary-500-rgb), 0.4);
    }
    
    &:active {
      transform: translateY(0);
    }
  }
  
  .avatar-uploader {
    .ant-upload {
      border-radius: 50%;
      border: 2px dashed var(--color-border-default);
      transition: all 0.3s ease;
      
      &:hover {
        border-color: var(--color-primary-500);
      }
    }
  }

  // 弹窗样式优化 - 统一限制为80vh
  .ant-modal {
    // 强制限制弹窗最大高度为80vh
    max-height: 80vh !important;
    
    .ant-modal-content {
      max-height: 80vh !important;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    
    .ant-modal-header {
      border-bottom: 1px solid var(--color-border-light);
      flex-shrink: 0;
      padding: 16px 20px;
      
      .ant-modal-title {
        color: var(--color-text-primary);
        font-weight: 600;
        font-size: 16px;
      }
    }
    
    .ant-modal-body {
      padding: 16px 20px;
      overflow-y: auto;
      flex: 1;
      min-height: 0; // 重要：允许flex子元素收缩
      
      // 自定义滚动条样式
      &::-webkit-scrollbar {
        width: 6px;
      }
      
      &::-webkit-scrollbar-track {
        background: var(--color-bg-secondary);
        border-radius: 3px;
      }
      
      &::-webkit-scrollbar-thumb {
        background: var(--color-border-default);
        border-radius: 3px;
        
        &:hover {
          background: var(--color-primary-400);
        }
      }
      
      // Firefox滚动条样式
      scrollbar-width: thin;
      scrollbar-color: var(--color-border-default) var(--color-bg-secondary);
    }
    
    .ant-modal-footer {
      flex-shrink: 0;
      border-top: 1px solid var(--color-border-light);
      padding: 12px 20px;
    }
  }

  // 注册弹窗特殊样式
  .register-modal {
    z-index: 10000 !important;
    
    // 确保注册弹窗不超过80vh
    .ant-modal-content {
      max-height: 80vh !important;
      z-index: 10000 !important;
    }
    
    .ant-modal-body {
      // 计算可用高度：80vh - header(48px) - footer(48px) - 边距
      max-height: calc(80vh - 96px) !important;
      padding: 12px 20px;
    }
    
    // 优化表单间距，减少垂直空间占用
    .ant-form-item {
      margin-bottom: 12px;
      
      &:last-child {
        margin-bottom: 0;
      }
      
      .ant-form-item-label {
        padding-bottom: 4px;
        
        label {
          font-size: 14px;
        }
      }
      
      .ant-form-item-control {
        .ant-input,
        .ant-input-password,
        .ant-select-selector {
          height: 36px;
          font-size: 14px;
        }
      }
    }
    
    // 头像上传区域优化
    .avatar-uploader {
      margin-bottom: 8px;
      
      .ant-upload {
        width: 56px !important;
        height: 56px !important;
        
        .ant-upload-select {
          width: 56px !important;
          height: 56px !important;
        }
      }
    }
    
    // 按钮区域优化
    .ant-space {
      margin-top: 8px;
      
      .ant-btn {
        height: 36px;
        font-size: 14px;
      }
    }
  }

  // 重置密码弹窗样式
  .reset-modal {
    .ant-modal-content {
      max-height: 80vh !important;
    }
    
    .ant-modal-body {
      max-height: calc(80vh - 96px) !important;
      padding: 16px 20px;
    }
    
    .ant-form-item {
      margin-bottom: 14px;
      
      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  // 按钮间距优化
  .ant-space {
    width: 100%;
    
    .ant-space-item {
      flex: 1;
      
      .ant-btn {
        width: 100%;
      }
    }
  }
}

// 全局弹窗样式 - 强化防止页面滚动
.ant-modal-root {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  z-index: 9999 !important;
  
  .ant-modal-mask {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 9999 !important;
  }
  
  .ant-modal-wrap {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    
    .ant-modal {
      position: relative !important;
      top: auto !important;
      left: auto !important;
      transform: none !important;
      margin: 20px !important;
      max-height: 80vh !important;
      z-index: 10001 !important;
    }
  }
}

// 防止弹窗打开时页面滚动 - 强化版本
body.modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

// 全局强制限制，确保任何弹窗都不超过80vh
.ant-modal-wrap {
  .ant-modal {
    max-height: 80vh !important;
    
    .ant-modal-content {
      max-height: 80vh !important;
    }
  }
}

// 确保弹窗在移动端也不会导致滚动
@media (max-width: 768px) {
  .ant-modal-root {
    .ant-modal-wrap {
      padding: 8px !important;
      
      .ant-modal {
        margin: 8px !important;
        max-height: 80vh !important;
        width: calc(100vw - 16px) !important;
      }
    }
  }
  
  .auth-container {
    .register-modal,
    .reset-modal {
      .ant-modal-content {
        max-height: 80vh !important;
      }
      
      .ant-modal-body {
        max-height: calc(80vh - 80px) !important;
        padding: 8px 12px;
      }
      
      .ant-form-item {
        margin-bottom: 8px;
        
        .ant-form-item-control {
          .ant-input,
          .ant-input-password,
          .ant-select-selector {
            height: 32px;
            font-size: 13px;
          }
        }
      }
    }
  }
}

// 阳光光束动画效果
@keyframes sunbeamGlow {
  0%, 100% {
    opacity: 0.4;
    transform: rotate(25deg) scaleY(1);
  }
  33% {
    opacity: 0.7;
    transform: rotate(25deg) scaleY(1.05);
  }
  66% {
    opacity: 0.6;
    transform: rotate(25deg) scaleY(0.98);
  }
}

@keyframes lightParticleFloat {
  0%, 100% {
    transform: translateY(0px) translateX(0px) scale(1);
    opacity: 0.5;
  }
  25% {
    transform: translateY(-10px) translateX(6px) scale(1.1);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-6px) translateX(12px) scale(1.2);
    opacity: 1;
  }
  75% {
    transform: translateY(-15px) translateX(3px) scale(1.05);
    opacity: 0.7;
  }
}

// 阳光光束动画 - 简化版本，只有透明度变化
.sunbeam {
  animation: sunbeamGlow 8s ease-in-out infinite;
  
  &:nth-child(2) {
    animation-delay: 2s;
    animation-duration: 10s;
  }
  
  &:nth-child(3) {
    animation-delay: 4s;
    animation-duration: 12s;
  }
  
  &:nth-child(4) {
    animation-delay: 6s;
    animation-duration: 9s;
  }
}

// 光粒子动画 - 保持轻微的浮动效果
.light-particle {
  animation: lightParticleFloat 6s ease-in-out infinite;
  
  &:nth-child(2) {
    animation-delay: 2s;
    animation-duration: 8s;
  }
  
  &:nth-child(3) {
    animation-delay: 4s;
    animation-duration: 7s;
  }
}

// 波纹效果
.ripple-effect {
  position: absolute;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 30%, rgba(255, 255, 255, 0.1) 60%, transparent 100%);
  pointer-events: none;
  z-index: 5;
  animation: rippleExpand 0.3s ease-out forwards;
  transform: translate(-50%, -50%);
}

@keyframes rippleExpand {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
    transform: translate(-50%, -50%) scale(0);
  }
  100% {
    width: 120px;
    height: 120px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}